/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modelo;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Elias Mendoza
 */
@Entity
@Table(name = "sa3")
@NamedQueries({
  @NamedQuery(name = "Sa3.findAll", query = "SELECT s FROM Sa3 s"),
  @NamedQuery(name = "Sa3.findByNoReg", query = "SELECT s FROM Sa3 s WHERE s.noReg = :noReg"),
  @NamedQuery(name = "Sa3.findByIdSensor", query = "SELECT s FROM Sa3 s WHERE s.idSensor = :idSensor"),
  @NamedQuery(name = "Sa3.findByHumedad", query = "SELECT s FROM Sa3 s WHERE s.humedad = :humedad"),
  @NamedQuery(name = "Sa3.findByFecha", query = "SELECT s FROM Sa3 s WHERE s.fecha = :fecha"),
  @NamedQuery(name = "Sa3.findByHora", query = "SELECT s FROM Sa3 s WHERE s.hora = :hora"),
  @NamedQuery(name = "Sa3.findByValRiego", query = "SELECT s FROM Sa3 s WHERE s.valRiego = :valRiego"),
  @NamedQuery(name = "Sa3.findByNd", query = "SELECT s FROM Sa3 s WHERE s.nd = :nd")})
public class Sa3 implements Serializable {
  private static final long serialVersionUID = 1L;
  @Id
  @Basic(optional = false)
  @Column(name = "no_reg")
  private Integer noReg;
  @Column(name = "id_sensor")
  private String idSensor;
  // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
  @Column(name = "humedad")
  private Double humedad;
  @Column(name = "fecha")
  @Temporal(TemporalType.DATE)
  private Date fecha;
  @Column(name = "hora")
  @Temporal(TemporalType.TIME)
  private Date hora;
  @Column(name = "val_riego")
  private String valRiego;
  @Column(name = "nd")
  private Integer nd;

  public Sa3() {
  }

  public Sa3(Integer noReg) {
    this.noReg = noReg;
  }

  public Integer getNoReg() {
    return noReg;
  }

  public void setNoReg(Integer noReg) {
    this.noReg = noReg;
  }

  public String getIdSensor() {
    return idSensor;
  }

  public void setIdSensor(String idSensor) {
    this.idSensor = idSensor;
  }

  public Double getHumedad() {
    return humedad;
  }

  public void setHumedad(Double humedad) {
    this.humedad = humedad;
  }

  public Date getFecha() {
    return fecha;
  }

  public void setFecha(Date fecha) {
    this.fecha = fecha;
  }

  public Date getHora() {
    return hora;
  }

  public void setHora(Date hora) {
    this.hora = hora;
  }

  public String getValRiego() {
    return valRiego;
  }

  public void setValRiego(String valRiego) {
    this.valRiego = valRiego;
  }

  public Integer getNd() {
    return nd;
  }

  public void setNd(Integer nd) {
    this.nd = nd;
  }

  @Override
  public int hashCode() {
    int hash = 0;
    hash += (noReg != null ? noReg.hashCode() : 0);
    return hash;
  }

  @Override
  public boolean equals(Object object) {
    // TODO: Warning - this method won't work in the case the id fields are not set
    if (!(object instanceof Sa3)) {
      return false;
    }
    Sa3 other = (Sa3) object;
    if ((this.noReg == null && other.noReg != null) || (this.noReg != null && !this.noReg.equals(other.noReg))) {
      return false;
    }
    return true;
  }

  @Override
  public String toString() {
    return "modelo.Sa3[ noReg=" + noReg + " ]";
  }
  
}
